<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link href="../../style/css/back/style.css" rel="stylesheet" type="text/css"/>
    <script src="../../style/js/jquery-1.8.3.js" type="text/javascript" charset="utf-8"></script>
    <script src="../../style/js/echarts-all.js"></script>

    <script type="text/javascript">
        //按照新闻类型统计
        function newsType() {
            $.get("../../news/statisticsByType", function (res) {
                //加载图形
                var myChart = echarts.init(document.getElementById('main'));
                var option = {
                    tooltip: {
                        show: true
                    },
                    legend: {
                        data: ['数量']
                    },
                    xAxis: [
                        {
                            type: 'category',
                            data: res.data.x
                        }
                    ],
                    yAxis: [
                        {
                            type: 'value'
                        }
                    ],
                    series: [
                        {
                            "name": "数量",
                            "type": "bar",
                            "data": res.data.y
                        }
                    ]
                };
                // 为echarts对象加载数据
                myChart.setOption(option);
            })
        }

        //按照发布人统计
        /*function opeater() {
            $.get("../../news/statisticsByAdmin", function (res) {
                //加载图形
                var myChart = echarts.init(document.getElementById('main'));
                var option = {
                    tooltip: {
                        show: true
                    },
                    legend: {
                        data: ['数量']
                    },
                    xAxis: [
                        {
                            type: 'category',
                            data: res.data.x
                        }
                    ],
                    yAxis: [
                        {
                            type: 'value'
                        }
                    ],
                    series: [
                        {
                            "name": "数量",
                            "type": "bar",
                            "data": res.data.y
                        }
                    ]
                };
                // 为echarts对象加载数据
                myChart.setOption(option);
            })
        }*/
    </script>
</head>
<body>
<!-- 顶部按钮 -->
<div class="tools">
    <ul class="toolbar">
        <!--增加链接-->
        <li class="click">
            <span onclick="newsType()"><img src="../../style/img/back/t01.png"/></span>
            新闻类型
        </li>
        <li class="click">
            <span onclick="opeater()"><img src="../../style/img/back/t01.png"/></span>
            发布人
        </li>
    </ul>
</div>

<div id="main" style="height:400px"></div>

</body>
</html>